<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="JSPBasicGrammar.filter_monitor05.monitor.Message" %>
    <%@ page import="JSPBasicGrammar.filter_monitor05.monitor.UserListener" %>
    <%@ page import="java.util.*" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

<%
//获取Message类中已经创建好的对象
Message mess2=Message.getMessage();

//创建事件类对象
UserListener lis=new UserListener();

String userName=request.getParameter("userName");

//将表单值传进user
lis.setUser(userName);

//将lis对象以user名存放进session对象中
session.setAttribute("user", lis);

//将事件类中获取的值传进后台处理类中
mess2.addUser(lis.getUser());

//设置session中对象的最大存活期
session.setMaxInactiveInterval(20);


%>

<textarea rows="5" cols="20">

<%
/* 将所有的值遍历输出 */
Vector ter=mess2.query();

if(ter!=null&&ter.size()>0){
	for(int i=0;i<ter.size();i++){
		out.println(ter.elementAt(i));
	}
	
}
%>
</textarea>

<a href="return.jsp">返回</a>


</body>
</html>